from django.db.models import CharField,ForeignKey,DateTimeField,IntegerField,BooleanField,DateField,DecimalField,TextField,DO_NOTHING,PROTECT
from apps.vadmin.op_drf.models import CoreModel


class Accessories_Users(CoreModel):
    accessory = ForeignKey(to="assets.Accessories",null=True,db_constraint=False,on_delete=PROTECT,verbose_name="关联的附属品")
    assigned_to = ForeignKey(to="permission.UserProfile",null=True,db_constraint=False,on_delete=PROTECT,related_name="accesssory_assigned_user",verbose_name="关联的用户id")
    notes = CharField(max_length=256,null=True,verbose_name="备注")

    class Meta:
        verbose_name = '配件分配给用户关系表'
        verbose_name_plural = verbose_name
        ordering = ['-id']
